#include <vector>

using namespace std;


/**
 * @brief 1480. 一维数组的动态和
 * https://leetcode.cn/problems/running-sum-of-1d-array/
 * [前缀和]
 */
class Solution {
public:
    vector<int> runningSum(vector<int>& nums) {
        int n = nums.size();
        vector<int> res(n);
        res[0] = nums[0];
        for (int i = 1; i < n; i++) {
            res[i] = res[i-1] + nums[i];
        }
        return res;
    }
};
